<template>
	<view>
		<view class="rich_text_module">
			<u-parse class="Descriptionofearningincome" :content="inCome" v-if="title =='赚取收益说明'"></u-parse>
			<u-parse :content="menberRight" v-else></u-parse>
		</view>
		<view class="service">
			<image :src="service_icon" @click="toService"></image>
		</view>
	</view>
</template>

<script>
	import uParse from '@/components/un-parse/u-parse.vue'
	import endingColor from '../../../common/endingColor.vue'
	export default{
		components:{endingColor,uParse},
		data(){
			return{
				title: '',
				service_icon: this.$imgUrl + 'img/member/service_icon.png',
				inCome: '',
				menberRight: ''
			}
		},
		onLoad(options) {
			console.log(options)
			if(options.page == 'jurisdictionExplain'){
				uni.setNavigationBarTitle({
					title: '权益说明'
				})
				this.title = '会员权限说明'
			}else{
				uni.setNavigationBarTitle({
					title: '如何赚收益'
				})
				this.title = '赚取收益说明'
			}
			this.getSetInfo()
		},
		methods: {
			// 获取设置信息
			getSetInfo() {
				this.$api.get_set_info({}).then(res => {
					if(res.status) {
						this.menberRight = res.data.menberRight
						this.inCome = res.data.inCome
					}else {
						uni.showToast({
							title: res.msg,
							icon: 'none',
							duration: 2000
						})
					}
					console.log('获取设置信息',res)
				}).catch(err => {
					console.log('获取设置信息',err)
				})
			},
			toService() {
				if(this.$store.getters.getToken) {
					uni.navigateTo({
						url: '../../service/service'
					})
				}else {
					uni.showToast({
						title: '请先登录！',
						icon: 'none',
						duration: 2000
					})
					setTimeout(()=>{
						uni.switchTab({
							url: '../../home/home'
						})
					},1000)
				}
			}
		}
	}
</script>

<style>
	.rich_text_module{
		padding: 20upx 30upx;
		background: #fff;
       
	}
    .rich_text_module .Descriptionofearningincome{
         border: 10upx solid #000000;
    }
	.service{
		width: 114upx;
		height: 114upx;
		position: fixed;
		bottom: 40upx;
		right: 40upx;
	}
	.service>image{
		width: 100%;
		height: 100%;
	}
</style>
